<?php

require_once '../smarty_lib/Smarty.class.php';
require_once '../lib/DBClass.php';
require_once 'lib/Admin.php';
require_once 'lib/Insert.php';

$smarty = new Smarty();
$acc = new Admin();
$insert = new Insert();

$smarty->template_dir = 'template/';
$smarty->compile_dir = 'template_c/';

if(!$acc->validate_cookie()){
	$smarty->assign('error','Anda tidak mepunyai akses untuk membuka halaman ini');
	$smarty->display('index.html');
}else{
	$smarty->assign('cookie', $insert->insert_game());
	$smarty->assign('page','home.html');
	$smarty->assign('title','Dashboard');

	$smarty->display('b.html');
}


